import dayjs from "dayjs";
type FormatTime =
  | "YYYY/MM/DD"
  | "MM/DD"
  | "YYYY/MM"
  | "DD/MM/YYYY"
  | "DD/MM/YY"
  | "DD-MM-YYYY"
  | "DD-MM-YY"
  | "YYYY-MM-DD";
export const changeTime = (
  startTime: string,
  endTime: string,
  format: FormatTime
) => {
  return [
    dayjs(JSON.parse(JSON.stringify(startTime))).format(format),
    dayjs(JSON.parse(JSON.stringify(endTime))).format(format),
  ];
};

export const timeEcho = (startTime: string, endTime: string, format: FormatTime) => {
  return [dayjs(startTime, format), dayjs(endTime, format)];
};
